using System;
using System.Linq;
using System.Collections.Generic;

namespace FoundationLib.Mail 
{
	/// <summary>
	/// This interface provides methods for accessing email functionality.
	/// </summary>
	public interface IMailConnector : IDisposable
	{
		/// <summary>
		/// Closes the connector.
		/// </summary>
		void Close();

		/// <summary>
		/// Gets a value indicating whether this connector is open and ready to send.
		/// </summary>
		bool IsOpen
		{
			get;
		}

		/// <summary>
		/// Opens the connector.
		/// </summary>
		void Open();

		/// <summary>
		/// Sends an email.
		/// </summary>
		/// <exception cref="ArgumentNullException">A null-reference was passed.
		/// </exception>
		/// <exception cref="ArgumentException">An argument is malformed.</exception>
		/// <param name="recipients">A list of recipient email addresses</param>
		/// <param name="subject">The mail subject</param>
		/// <param name="contents">The mail contents</param>
		void Send(IEnumerable<string> recipients, string subject, string contents);
	}

}